$(function () {
    $(".repair_click").click(function () {
        // console.log($("#uploaderInput").files())
        var formData = new FormData($( "#uploadForm" )[0]);
        $.ajax({
            url: "../../../front/php/repair.php",
            type: 'POST',
            data: formData,
            cache: false,
            contentType: false,
            processData: false,
            success: function (r) {
                console.log(r);
            },
            error: function (r) {
                alert(r);
            }
        });
        var req_data = {
            bike_card:$("input[type='number']").val(),
            remarks:$("input[type='text']").val(),
            repaie_type:[]
        }
        $("input[type='checkbox']:checked").each(function (i) {
            req_data['repaie_type'][i] = ($("input[type='checkbox']:checked").eq(i).prop("id"));
        })
        $.ajax({
            url: "../../../front/php/repair.php",
            type: 'POST',
            data: req_data,
            success: function (r) {
                console.log(r);
            },
            error: function (r) {
                alert(r);
            }
        })
    })
})
